﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<Spenta.StreetCare.Core.Models.Report>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Index
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <h2>Index</h2>

    <table>
        <tr>
            <th>
                Title
            </th>
            <th>
                Date
            </th>
            <th>
                Status
            </th>
            <th>
                Category
            </th>
            <th>
                Location
            </th>
            <th>
                Image
            </th>
            <th>
                Fixed image
            </th>
            <th></th>
        </tr>

    <% foreach (var item in Model) { %>
    
        <tr>
            <td>
                <%: Html.ActionLink(item.ReportTitle, "Details", new { id = item.ReportID })%>
            </td>
            <td>
                <%: String.Format("{0:dd/MM/yyyy}", item.ReportWhen) %>
            </td>
            <td>
                <%: item.Status.StatusTitle %>
            </td>
            <td>
                <%: item.Category.CategoryTitle %>
            </td>
            <td>
                <%: item.ReportLocation %>
            </td>
            <td>                
            <% if (!string.IsNullOrEmpty(item.ReportImageUrl)){%>
                <img alt="Image uploaded by the citizen" src="/ClientBin<%:item.ReportImageUrl%>" />
            <%}%>
            </td>
            <td>
            <% if (!string.IsNullOrEmpty(item.ReportFixedImageUrl)){%>
                <img alt="Image uploaded by the administrator" src="/ClientBin<%:item.ReportFixedImageUrl%>" />
            <%}%>
            </td>
            <td>
                <%: Html.ActionLink("Edit", "Edit", new { id=item.ReportID }) %>
                |
                <%: Html.ActionLink("Delete", "Delete", new { id=item.ReportID })%>
                |
                <%: Html.ActionLink("Fix", "Fix", new { id=item.ReportID })%>
            </td>
        </tr>
    
    <% } %>

    </table>

    <p>
    </p>

</asp:Content>

